package jjn.acwing.contest.issue119;

import java.util.Scanner;

/**
 * @author Jjn
 * @since 2023/9/2 19:11
 */
public class Acwing5143 {
    static void recoverAndPrint(String input) {
        if (input.length() <= 2) {
            System.out.println(input);
            return;
        }
        int length = input.length();
        StringBuilder s = new StringBuilder();
        s.append(input.charAt(0));
        for (int i = 1; i < length - 1; i += 2) {
            s.append(input.charAt(i));
        }
        s.append(input.charAt(length - 1));
        System.out.println(s);
    }
    
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            int n = sc.nextInt();
            for (int i = 0; i < n; i++) {
                String s = sc.next();
                recoverAndPrint(s);
            }
        }
    }
}
